package cn.mgm.advanced.pool;

import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource;
import org.junit.Test;

import java.io.IOException;
import java.io.InputStream;
import java.sql.Connection;
import java.util.Properties;

public class HikariTest {

    @Test
    public void softCodeTest() throws Exception {

        Properties properties = new Properties();

        InputStream resourceAsStream = HikariTest.class.getClassLoader().getResourceAsStream("hikari.properties");
        properties.load(resourceAsStream);
        System.out.println(properties);

        HikariConfig hikariConfig = new HikariConfig(properties);

        HikariDataSource hikariDataSource = new HikariDataSource(hikariConfig);

        Connection connection = hikariDataSource.getConnection();
        System.out.println(connection);
    }
}
